package zjy;

public class Triangle {
    private double sideA;
    private double sideB;
    private double sideC;

    public Triangle(double sideA, double sideB, double sideC) {
        this.sideA = sideA;
        this.sideB = sideB;
        this.sideC = sideC;
    }

    public Triangle() {
        this.sideA = 1.0;
        this.sideB = 1.0;
        this.sideC = 1.0;
    }

    public double getSideB() {
        return sideB;
    }

    public void setSideB(double sideB) {
        this.sideB = sideB;
    }

    public double getSideC() {
        return sideC;
    }

    public void setSideC(double sideC) {
        this.sideC = sideC;
    }

    public double getSideA() {
        return sideA;
    }

    public void setSideA(double sideA) {
        this.sideA = sideA;
    }

    public double getArea() {
        double p;
        p = (this.sideA + this.sideB + this.sideC) / 2;
        double S = Math.sqrt(p * (p - this.sideA) * (p - this.sideB) * (p * this.sideC));
        return S;
    }

    public double getLength() {
        double C = this.sideA + this.sideB + this.sideB;
        return C;
    }

    public void judge() {
        if (this.sideA + this.sideB <= this.sideC || this.sideC + this.sideB <= this.sideA || this.sideA + this.sideC <= this.sideB) {
            System.out.println("不合理");
        }
        else{
            System.out.println("合理");
        }
    }
}
